package com.TrainingCenter.entity;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: ibook
 * Date: 30.04.14
 * Time: 11:29
 * To change this template use File | Settings | File Templates.
 */
@Table(name = "notification", schema = "public", catalog = "TrainingCenter")
@Entity
public class Notification implements Persitent{
    private int idNotification;

    @Column(name = "id_notification")
    @Id
    public int getId() {
        return idNotification;
    }

    public void setId(int idNotification) {
        this.idNotification = idNotification;
    }

    private String subject;

    @Column(name = "subject")
    @Basic
    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    private String message;

    @Column(name = "message")
    @Basic
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    private String description;

    @Column(name = "description")
    @Basic
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    private String eMail;

    @Column(name = "e_mail")
    @Basic
    public String geteMail() {
        return eMail;
    }

    public void seteMail(String eMail) {
        this.eMail = eMail;
    }

    private boolean status;

    @Column(name = "status")
    @Basic
    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    private double mark;

    @Column(name = "mark")
    @Basic
    public double getMark() {
        return mark;
    }

    public void setMark(double mark) {
        this.mark = mark;
    }

    private int delivaryNum;

    @Column(name = "delivary_num")
    @Basic
    public int getDelivaryNum() {
        return delivaryNum;
    }

    public void setDelivaryNum(int delivaryNum) {
        this.delivaryNum = delivaryNum;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Notification that = (Notification) o;

        if (delivaryNum != that.delivaryNum) return false;
        if (idNotification != that.idNotification) return false;
        if (Double.compare(that.mark, mark) != 0) return false;
        if (status != that.status) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (eMail != null ? !eMail.equals(that.eMail) : that.eMail != null) return false;
        if (message != null ? !message.equals(that.message) : that.message != null) return false;
        if (subject != null ? !subject.equals(that.subject) : that.subject != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result;
        long temp;
        result = idNotification;
        result = 31 * result + (subject != null ? subject.hashCode() : 0);
        result = 31 * result + (message != null ? message.hashCode() : 0);
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + (eMail != null ? eMail.hashCode() : 0);
        result = 31 * result + (status ? 1 : 0);
        temp = mark != +0.0d ? Double.doubleToLongBits(mark) : 0L;
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        result = 31 * result + delivaryNum;
        return result;
    }
}
